<template>
  <div class="vip">
    <div class="tabs-box">
      <div class="tabs" @click="goInfo(3)">
        <div>
          <img
            src="../../assets/images/30.png"
            alt=""
          >
          <span>高级VIP</span>
        </div>
        <div><span class="num">{{numData.advancedvip}}人</span><i class="icon iconfont icon-xiangyou"></i></div>
      </div>
      <div class="tabs" @click="goInfo(2)">
        <div>
          <img
            src="../../assets/images/30.png"
            alt=""
          >
          <span>普通VIP</span>
        </div>
        <div><span class="num">{{numData.regularvip}}人</span><i class="icon iconfont icon-xiangyou"></i></div>
      </div>
       <div class="tabs" @click="goInfo(1)">
        <div>
          <img
            src="../../assets/images/30.png"
            alt=""
          >
          <span>普通会员</span>
        </div>
        <div><span class="num">{{numData.regular}}人</span><i class="icon iconfont icon-xiangyou"></i></div>
      </div>
    </div>
  </div>
</template>
<script>
import { directlyList } from "../../api/user";
export default {
  data() {
    return {
      isfull: false,
      numData:{},
      member:'',
    };
  },
  methods:{
    goInfo(id) {
      this.$router.push({
        path:"/vipinfo",
        query:{
          membership:this.member,
          rankid:id,
        }
      })
    },
    getNum() {
      const member = this.$route.query.membership;
      this.member = member;
      directlyList({membership:this.$route.query.membership}).then(res => {
        console.log(res);
        if(res.status == 200) {
          this.numData = res.data;
        }
      })
    }
  },
  created() {
    this.getNum();
  }
};
</script>
<style lang="scss">
.vip {
  width: 100%;
  padding-bottom: 48px;
  background-color: #f5f5f5;
  header {
    color: #fff;
  }
  .tabs-box {
    width: 100%;

    .tabs {
      margin-top: 10px;
      width: 100%;
      height: 48px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 0 15px;
      background-color: #fff;
      border-bottom: 1px solid #eee;
      img {
        width: 25px;
        vertical-align: middle;
      }
      span {
        padding-left: 10px;
        font-size: 16px;
        vertical-align: middle;
      }
      i {
        vertical-align: middle;
        margin-left: 10px;
        font-size: 16px;
      }
      .num {
        color: #f44;
      }
    }
  }
}
</style>

